b94c4267cb4436555b15b1908a6fd6b048a06967,portal-impl/src/com/liferay/portal/jsonwebservice/action/JSONWebServiceDiscoverAction.java,JSONWebServiceDiscoverAction,_formatType,#Class#Class[]#,170
Before Change
return _formatType(componentType, genericTypes) + "[]";
}
if (type.isPrimitive()) {
return type.getSimpleName();
}
else if (type.equals(Date.class)) {
return "long";
}
else if (type.equals(Locale.class) || type.equals(String.class)) {
return "string";
}
else if (type.equals(Object.class) || type.equals(Serializable.class)) {
return "object";
}
String typeName = type.getName();
if (type.equals(List.class)) {
typeName = "list";
}
else if (type.equals(Map.class)) {
typeName = "map";
}
else {
_types.add(type);
}
if (genericTypes == null) {
return "object<" + typeName + ">";
}
StringBundler sb = new StringBundler(genericTypes.length * 2 + 1);
After Change
return types;
}
private String _formatType(Class<?> type, Class<?>[] genericTypes) {
if (type.isArray()) {
Class<?> componentType = type.getComponentType();
return _formatType(componentType, genericTypes) + "[]";
}
if (type.isPrimitive()) {
return type.getSimpleName();
}
if (type.equals(File.class)) {
return "file";
}
else if (type.equals(Boolean.class)) {
return "boolean";
}
else if (type.equals(Date.class)) {
return "long";
}
else if (type.equals(Locale.class)) {
return "string";
}
else if (type.equals(TimeZone.class)) {
return "string";
}
else if (type.equals(String.class)) {
return "string";
}
else if (type.equals(Object.class) || type.equals(Serializable.class)) {
return "map";
}
else if (ReflectUtil.isSubclass(type, Number.class)) {
String typeName = null;
if (type == Integer.class) {
typeName = "int";
}
else if (type == Character.class) {
typeName = "char";
}
else {
typeName = StringUtil.toLowerCase(type.getSimpleName());
}
return typeName;
}
String typeName = type.getName();